﻿

using System;
using Demo.Domain;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;

namespace Demo.Domain
{
    public class ActionMapping: EntityTypeConfiguration<Action>
    {
        public ActionMapping()
        {
            this.HasKey(a => a.ActionID).Property(u => u.ActionID).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(a => a.Name).HasMaxLength(20).IsRequired();
            this.Property(a => a.ModuleID).IsRequired();
            this.Property(a => a.Sort).IsRequired();
        }
    }
}
